package com.china.produce.listener;

import com.china.produce.event.AddDataEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * @ClassName
 * @Author niujie
 * @Version
 * @Description
 * @CreateTime 2022/12/17
 */
@Component
@Slf4j
public class AddDataEventListener {

    @EventListener(classes = AddDataEvent.class)
    public void handler1(AddDataEvent event) {
        System.out.println("发布 1 " + event);
    }

    @EventListener(classes = AddDataEvent.class)
    public void handler2(AddDataEvent event) {
        System.out.println("发布2 " + event);
    }
}
